package no.sachmuld.methodcombination.api.reflection;

import no.sachmuld.methodcombination.api.reflection.component.SimpleMethodCombination;

/**
*
*/
public class And extends SimpleMethodCombination<Object, Boolean, Boolean> {

    private Boolean combinedResult;

    @Override
    protected boolean handleSingleResult(Boolean singleResult) {
        if (combinedResult == null) {
            combinedResult = singleResult;
        } else {
            combinedResult = combinedResult && singleResult;
        }
        return combinedResult;
    }

    @Override
    protected Boolean combinedResult() {
        return combinedResult;
    }
}
